<meta charset="utf-8">
<div class="box box-primary" id="pmpTasks_edit">
	<form role="form" id="editForm" >
		<div class="box-body">
			
			<div class="form-group" hidden="true">
				<input type="text" name="projectId" v-model="pmpTasks.projectId"
					class="form-control" id="projectId" >
			</div>
			
			
			<div class="form-group">
				<label>所属项目版本</label>
				<select type="text" name="projectVersionId" class="form-control" id="projectVersionId" v-model="pmpTasks.projectVersionId" 
					v-kselect="{url:'/pmp/service/pub/pmpProject/loadProjectVersionComboboVo',vmodel:'pmpTasks.projectVersionId',linkToDomId:'projectId',ajaxParamKey:'projectId',firstEmpty:'true'}">
				</select>
	       </div>
	   </div>
	   <div class="box-footer">
			<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
			<button type="button" class="btn btn-info pull-right"v-on:click="update">提交</button>
		</div>
	</form>
</div>
<script type="text/javascript">
		var news = new Vue({
			el : '#pmpTasks_edit',
			data : {
				pmpTasks : {
					projectId : null,
					projectVersionId : null,
					taskName : null,
					taskDetail : null
				},
				bus : new Vue(),
			},
			mounted : function() {
				var _this = this;
				var param = zfesLayerEditDg.getLayerParam();//任务id 
				var url = "/pmp/service/pub/pmpTasks/loadPmpTasks";
				zfesAjax.ajaxTodo(url, param, function(data) {
					_this.$data.pmpTasks = data.data.pmpTasks;
				})
			},
			methods : {
				update : function() {
					if ($("#editForm").valid()) {
						let _this = this;
						let url = "/pmp/service/pm/pmpTasks/updatePmpTasks";
						zfesAjax.ajaxTodo(url, _this.$data.pmpTasks, function(
								data) {
							alertSwal.successText(data.message);
							layer.close(layer.index);
						})
					}
				},
				cancle : function() {
					layer.close(layer.index);
				}
			}
		});
</script>
